import org.apache.tomcat.util.buf.CharsetUtil;
import org.springframework.util.ObjectUtils;

import java.io.*;
import java.net.Socket;
import java.util.*;
import java.util.concurrent.LinkedBlockingQueue;

public class Main {
    public static void main(String[] args) {
        File file = new File("C:\\Users\\xyl\\Desktop/temp.txt");
        FileReader fr;
        BufferedReader br;
        try {
            fr = new FileReader(file);
            br = new BufferedReader(fr);
            String temp = null;
            while((temp  = br.readLine()) != null){
                if (!temp.contains("private")) {
                    continue;
                }
                if (temp.contains("//")) {
                    temp = temp.substring(0, temp.indexOf("//"));
                }
                temp = temp.substring(temp.lastIndexOf(" ")+1, temp.indexOf(";"));
                char[] chars = temp.toCharArray();
                Queue<Character> queue = new LinkedBlockingQueue<>();
                for (char aChar : chars) {
                    if (Character.isUpperCase(aChar)) {
                        queue.add('_');
                        queue.add(Character.toLowerCase(aChar));
                    }else{
                        queue.add(aChar);
                    }
                }
                for (Character character : queue) {
                    System.out.print(character);
                }
//                System.out.print("#{"+temp+"},");
                System.out.println();
            }
        } catch (IOException e) {
            e.printStackTrace();
        }

    }
}